﻿@model IEnumerable<WorkTimePrj.Models.Item>
@{
    ViewBag.Title = "Index";
}
<!DOCTYPE html>
<html>
<head>
    <title>工时确认</title>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/css/ClearFloat.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.7.min.js")" type="text/javascript"></script>
    <style type="text/css">
        body { color: #000000; }
        .field-validation-error { float: none; }
        .body ul.cur li { height: 30px; line-height: 30px; }
        .editor-label { width: 90px; float: left; }
        .editor-field { float: left; }
        .Button01 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #003677; height: 20px; border: solid 1px #5381B3; padding-left: 4px; padding-right: 4px; background: #ffffff; }
        table td { /*text-align:left;*/ padding: 10px 10px 0 10px; }
        span.H2 { font-family: simsun; font-size: 14px; font-weight: bold; margin-bottom: 0; /*border:solid 1px #d2d2d2;*/ padding: 10px; }
        .WP_1 { width: 95%; margin: 0 auto; }
        .WP_2 { /*width:99.5%; margin:0 auto;*/ border: solid 1px #c0d6ef; padding: 15px 0 0 0; background: #e4ecf5; }
        .WP_2 div { padding-bottom: 10px; }
        .WP_2 div.WP_6 { padding-bottom: 0; }
        .WP_3 { width: 600px; text-align: left; margin: 0 auto; /*float:left;*/ }
        .Btn01 { border: solid 1px #5381B3; }
        .Label01 { color: #440e62; }
        .Label02 { color: #440e62; font-weight: bold; }
        .Text01 { width: 550px; }
        .WP_4 { float: left; padding-top: 5px; }
        .WP_5 { float: left; }
        .WP_6 { float: left; background: #440E62; color: #ffffff; margin-left: 5px; width: 15px; height: 15px; line-height: 15px; }
    </style>
    }
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
</head>
<body>
    <div class="WP_1">
        <table style="border: solid 1px #d2d2d2">
            <tr>
                <td style="border-bottom: solid 1px #d2d2d2; text-align: left; background: #FDEEE6;
                    height: 55px;">
                    <span class="H2">工时确认</span> <span>时间 @ViewBag.startTime.ToString("yyyy-MM-dd") 至 @ViewBag.endTime.ToString("yyyy-MM-dd")</span>&nbsp;&nbsp;&nbsp;
                    <span>总共 @ViewBag.cnt 条工时需确认</span>&nbsp;&nbsp;&nbsp;
                    <button type="button" onclick="window.location.href='@Url.Action("Index", new { startTime = ViewBag.startTime.AddDays(-7), endTime = ViewBag.endTime.AddDays(-7) })'"
                            class="Btn01" style="line-height: 24px; height: 24px; margin-top: 2px;">
                        <span style="margin: 0px; padding: 0px;">上一周</span>
                    </button>
                    &nbsp;&nbsp;&nbsp;
                    @if (ViewBag.startTime.AddDays(7) < DateTime.Now)
                    { 
                        <button type="button" onclick="window.location.href='@Url.Action("Index", new { startTime = ViewBag.startTime.AddDays(7), endTime = ViewBag.endTime.AddDays(7) })'"
                            class="Btn01" style="line-height: 24px; height: 24px; margin-top: 2px;">
                            <span style="margin: 0px; padding: 0px;">下一周</span>
                        </button>
                    }
                </td>
            </tr>
            @{int i = 0;
              foreach (var item in Model)
              {
                  i = i + 1;
                <tr>
                    <td>
                        <div class="WP_2 group">
                            <div class="WP_6">
                                i</div>
                            <div class="WP_3">
                                <div>
                                    <span class="Label02">[@Html.DisplayFor(modelItem => item.Project.code)]</span>
                                    <span class="Label02">@Html.DisplayFor(modelItem => item.Project.display)</span>
                                </div>
                                <div>
                                    <label class="Label01">
                                        员工姓名：</label>
                                    <span>
                                        @Html.DisplayFor(modelItem => item.submitter)
                                    </span>&nbsp;&nbsp;&nbsp;
                                    <label class="Label01">
                                        时间段：</label>
                                    <span>
                                        @Html.DisplayFor(modelItem => item.worktime)
                                    </span>&nbsp;&nbsp;&nbsp;
                                    <label class="Label01">
                                        工作量：</label>
                                    <span>
                                        @Html.DisplayFor(modelItem => item.cost)H </span>
                                </div>
                                <div>
                                    <label class="Label01">
                                        单项内容：</label>
                                    <span>
                                        @Html.DisplayFor(modelItem => item.title)
                                    </span>
                                </div>
                                <div>
                                    <label class="Label01">
                                        确认状态：</label>
                                    @if (item.ack != null)
                                    {
                                        <span>
                                            @Html.DisplayFor(modelItem => item.ack_type)
                                        </span>
                                    }
                                    else
                                    {
                                        <span style="color: Red;">未确认 </span>
                                    }
                                </div>
                                @using (Html.BeginForm("Edit", "PM", new { startTime = ViewBag.startTime, endTime = ViewBag.endTime }))
                                {
                                    @Html.ValidationSummary(true)
                                    @Html.HiddenFor(modelItem => item.uid)
                                    @Html.HiddenFor(modelItem => item.pid)
                                    @Html.HiddenFor(modelItem => item.submitter)
                                    @Html.HiddenFor(modelItem => item.account)
                                    @Html.HiddenFor(modelItem => item.cost)
                                    @Html.HiddenFor(modelItem => item.submittime)
                                    @Html.HiddenFor(modelItem => item.starttime)
                                    @Html.HiddenFor(modelItem => item.title)
                                    @Html.HiddenFor(modelItem => item.status)
                                    @Html.HiddenFor(modelItem => item.role)
                                    @Html.HiddenFor(modelItem => item.ack_user)
                                    @Html.HiddenFor(modelItem => item.Brower)
                                    <div>
                                        <div class="WP_4">
                                            <label class="Label01">
                                                备注：</label>
                                        </div>
                                        <div class="WP_5">
                                            <span>@Html.TextAreaFor(modelItem => item.comment, 5, 105, new { @class = "Text01" })</span>
                                            @Html.ValidationMessageFor(modelItem => item.comment)
                                        </div>
                                    </div>
                                    <div>
                                        <label class="Label01">
                                            评价：</label>
                                        <span>满意</span><span>@Html.RadioButtonFor(modelItem => item.rate, "满意", new { @id = "good" })</span>
                                        <span>不满意</span><span>@Html.RadioButtonFor(modelItem => item.rate, "不满意", new { @id = "bad" })</span>
                                        @Html.ValidationMessageFor(modelItem => item.rate)
                                    </div>
                                    //if (ViewBag.startTime.AddDays(8) > DateTime.Now)
                                    //{ 
                                    <p style="text-align: center;">
                                        <input type="submit" value="确认" class="Btn01" />
                                    </p>
                                    //}
                                }
                            </div>
                        </div>
                    </td>
                </tr>
   
              }
            }
            @Html.CommonnScript()
        </table>
    </div>
</body>
</html>
